﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LGCourt.Logic.BLL;
using KMFrame.Permission.Util;

namespace lgweb.Judge
{
    public partial class aflterqa : System.Web.UI.Page
    {
        private string _AH = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                GetCaseALLInfo();
                GetList();
            }
        }
        private void GetParam()
        {
            this._AH = string.IsNullOrEmpty(Request.QueryString["ah"]) ? "" : Request.QueryString["ah"];
            if (string.IsNullOrEmpty(this._AH))
            {
                Response.Redirect("/user/index.aspx");
            }
            
        }
        private void GetList()
        {
            CaseInfo bll = new CaseInfo();

            int _userID = SessionBox.GetUserSession().UserID;
            UserCondition param = new UserCondition();
            param.AH = this._AH;
            param.UserID = _userID;

            CaseALLInfo result = (CaseALLInfo)bll.GetCaseALLInfo(param);

            if (result != null)
            {
                this.rptPHDY.DataSource = result.PHDYList;
                this.rptPHDY.DataBind();
            }
        }
         /// <summary>
        /// 获取文书与通知
        /// </summary>
        private void GetCaseALLInfo()
        {
            CaseInfo bll = new CaseInfo();

            int _userID = SessionBox.GetUserSession().UserID;
            UserCondition param = new UserCondition();
            param.AH = this._AH;
            param.UserID = _userID;

            CaseALLInfo result = (CaseALLInfo)bll.GetCaseALLInfo(param);

            if (result != null)
            {
                //this.spAH.InnerHtml = result.AH;
                this.tdAH.InnerHtml = result.AH;
                this.tdAJJZJD.InnerHtml = result.AJJZJD;
                this.tdCBR.InnerHtml = result.CBR;
                this.tdJABDW.InnerHtml = result.JABDW;
                this.tdJABDXW.InnerHtml = result.JABDXW;
                this.tdKTDD.InnerHtml = result.KTDD;
                this.tdKTRQ.InnerHtml = result.KTRQ.ToString();
                this.tdLAAY.InnerHtml = result.LAAY;
                this.tdLARQ.InnerHtml = result.LARQ.ToString();
                this.tdLXDH.InnerHtml = result.LXDH;
                this.tdSJY.InnerHtml = result.SJY;
                this.tdSSBD.InnerHtml = result.SSBD.ToString();
                this.tdSSQQ.InnerHtml = result.SSQQ;

                //当事人
                this.rptDSRXX.DataSource = result.DSRXXList;
                this.rptDSRXX.DataBind();

                if (result.ZZFSList.Count > 0)
                {
                    //this.divZXDT.Visible = true;
                    //this.rptZZFS1.DataSource = result.ZZFSList.Where(a=>a.ZZFS=="查封").ToList();
                    //this.rptZZFS1.DataBind();

                    //this.rptZZFS2.DataSource = result.ZZFSList.Where(a => a.ZZFS == "扣押").ToList();
                    //this.rptZZFS2.DataBind();

                    //this.rptZZFS3.DataSource = result.ZZFSList.Where(a => a.ZZFS == "冻结").ToList();
                    //this.rptZZFS3.DataBind();

                    //this.rptZZFS4.DataSource = result.ZZFSList.Where(a => a.ZZFS == "划拨").ToList();
                    //this.rptZZFS4.DataBind();
                }
            }
        }
    }
}